home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
422mods.zip
/
SKYNT017.422
< prev
next >
Wrap
Text File
|
1993-02-22
|
5KB
|
143 lines
I find this helpful, maybe you will too....
The Terminator #264 @13478
Fri Feb 19 12:17:10 1993
┌────────────────────────────────────────────────────────────────────────────┐
│ Mod Name: SKYNT017.MOD Mod Author : The Terminator │
│ Skynet BBS 314-352-8584 │
│ Difficulty: "Can You Block Copy?" Date: 15 February 1993 │
│ WWIV Version: 4.20e (CAUTION may require adapting to new Versions!) │
│ Files Affected: XFER.C, BBS.C, VARDEC.H │
│ Description: Allows selective deletion of files in Download Directories │
│ by age or Sysop's discretion. │
└────────────────────────────────────────────────────────────────────────────┘
I wrote this to allow a fast means of deleting old or unwanted uploads
from Skynet's Download Directories. It also automatically adds the file to
my TRASHFYL.DAT and prohibits it from being re-uploaded. If you have my
TRASHFYL.MOD (SKYNT008.MOD), simply remove the comments to make it active.
All you have to do is type //PURGE in the Transfer Menu. You will
be prompted for a month number. Simply add the month number such as "03"
for March, with a slash. "ie: 03/" The Mod will display the file info for all
files in the directory that were uploaded during March, and prompt for deletion
of each one individually. The Mod is limited to the current Sub you are in,
so you have to move to each sub you wish to "Purge".
If you wish to scan all the files in sequence in the sub, simply enter
an asterik "*" when you are prompted for the month. The Mod will then present
each file in the current sub, for review.
/**************************************************************************/
Open XFER.C: Block copy the following function at the end of the module.
void date_purge()
{
/* FILE *trash; TRASHFYL.MOD */
int i,i1,i2,ok;
char ch,s[81],s1[81],s2[81];
uploadsrec u;
dliscan();
nl();
prt(6," File Month to remove.");
outstr(":");
mpl(4);
input(s,4);
if (s[0]==0) {
closedl();
return;
}
SETREC(0);
read(dlf,(void *)&u,sizeof(uploadsrec));
i2=numf;
i=1;
while ((i<i2)) {
SETREC(i);
read(dlf,(void *)&u,sizeof(uploadsrec));
if ((strncmp(s,u.date,3)==0) || (strcmp(s,"*")==0)) {
printfileinfo(&u,udir[curdir].subnum);
prt(2,"Purge this File (Y/N/Q)");
ch=onek("YNQ");
if (ch=='Q')
return;
if (ch=='Y') {
/* sprintf(s2,"%s\n",u.filename); TRASHFYL.MOD */
/* sprintf(s1,"%sTRASHFYL.DAT",syscfg.gfilesdir); " " */
/* if((trash = fopen(s1,"at")) == NULL) " " */
/* prt(6,"Can't Open Trashfyl.Dat\n\r"); " " */
/* fputs(s2,trash); " " */
/* fclose(trash); " " */
sprintf(s1,"%s%s",directories[udir[curdir].subnum].path,u.filename);
unlink(s1);
if (u.mask & mask_extended)
delete_extended_description(u.filename);
sprintf(s1,"-%s Removed off of %s",u.filename,
directories[udir[curdir].subnum].name);
sysoplog(s1);
for (i1=i; i1<numf; i1++) {
SETREC(i1+1);
read(dlf,(void *)&u,sizeof(uploadsrec));
SETREC(i1);
write(dlf,(void *)&u,sizeof(uploadsrec));
}
--i;
--numf;
SETREC(0);
read(dlf, &u, sizeof(uploadsrec));
u.numbytes=numf;
SETREC(0);
write(dlf,(void *)&u,sizeof(uploadsrec));
}
}
++i;
}
closedl();
return;
}
Close XFER.C, your done here.
Open BBS.C: Move down to the "dlmainmenu" function and add a call to the
Purge function. You can add it right before the "/O" test.
if ((strcmp(s,"PURGE")==0) && (dc())) /* MOD ADD */
date_purge(); /* MOD ADD */
if (strcmp(s,"/O")==0)
Close BBS.C, you done here also.
Now just open VARDEC.H and add the function declaration and your done with
everything. If you don't know, you can add the declaration anywhere, but
it's easier to keep track if you place it with the other Xfer.C declarations.
Just add "void date_purge();" at the bottom of the list for Xfer.C. This
will force a full re-compile, but can't be helped.
WARNING: I have not upgraded to 4.22, mostly because I like what I've done
with 4.20e (and so do my Users) and I have made over 150+ mods to
my source. (Moving them to 4.22 is too much like work!) With just
a little knowledge of C programming, you should be able to adapt
any of my mods to most versions of WWIV
/***************************************************************************/
That's it kiddies. Wasn't so tough was it? This works fine in 4.20e
but I can't promise anything else. I've had a couple of my earlier mods act
funny in 4.21/22. Mostly because of supporting function calls that had changes
in them. So............. if you catch your foreskin in your zipper, if your
hard drive seeks psychiatric help, or if you or any of your I.M. Force should
be caught or killed, the Secretary will dissavow any knowledge of your actions.
It's not my problemo!